from django.http import HttpResponse
from django.shortcuts import redirect, reverse
from django.views.generic import View


class IndexView(View):
    def get(self, request, *args, **kwargs):
        # a = 0
        # b = 1
        # c = b/a
        username = request.GET.get('username')
        if username:
            return HttpResponse('首页')
        else:
            # return redirect(reverse('errors:400'))
            return redirect(reverse('errors:403'))

